package boardgamer.yavalath.client;

import android.content.Intent;
import boardgamer.common.client.preference.PreferenceUpdater;
import boardgamer.yavalath.client.resources.StringHandler;
import boardgamer.yavalath.common.YavalathGameSetting;
import boardgamer.yavalath.common.YavalathReplay;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * @author garysoed
 */
public class LiteProFeatures implements ProFeatures {

  private YavalathActivity activity;

  @Override
  public boolean isEnabled() {
    return false;
  }

  @Override
  public void initializeScreens(MainView gameView, YavalathActivity activity) {
    this.activity = checkNotNull(activity, "activity");
  }

  @Override
  public void startReplayLobbyView() {
    activity.showComingSoonDialog();
  }

  @Override
  public void startReplayView(YavalathReplay replay) {
    activity.showComingSoonDialog();
  }

  @Override
  public void startMultiplayerView() {
    activity.showComingSoonDialog();
  }

  @Override
  public void initializePreference(PreferenceUpdater.Builder updaterBuilder) { }

  @Override
  public YavalathGameSetting getGameSetting() {
    return YavalathGameSetting.DEFAULT;
  }

  private void openProMarket() {
    Intent marketIntent = new Intent(Intent.ACTION_VIEW);
    marketIntent.setData(StringHandler.instance().proMarketUrl);
    activity.startActivity(marketIntent);
  }
}
